﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Vote.ascx.cs" Inherits="Hxsoft.AppV1.Admin.VoteManage.Controls.Vote" %>
<script type="text/javascript">
<!--
function <%= this.ClientID %>_AddVoteItem(optionTitle, voteCount)
{
	var voteItemsBox = $("#<%= this.ClientID %>_VoteItemsBox");
	if(voteItemsBox)
	{
		var OptionTitle = document.createElement("INPUT");
		OptionTitle.name = "OptionTitle";
		OptionTitle.className = "OptionTitle";
		if(optionTitle) OptionTitle.value = optionTitle;
		
		var VoteCount = document.createElement("INPUT");
		VoteCount.name = "VoteCount";
		VoteCount.className = "VoteCount";
		if(voteCount) VoteCount.value = voteCount;
		
		voteItemsBox.append($("<div class=\"VoteItemBox\"></div>")
				.append(" 选项：").append(OptionTitle)
				.append(" 票数：").append(VoteCount)
				.append("<a href=\"javascript:void(0);\" onclick=\"<%= this.ClientID %>_DeleteVoteItem(this);\" class=\"SubtractVoteItemButton\">删除该调查项</a>")
			);
	}
}

function <%= this.ClientID %>_DeleteVoteItem(obj)
{
	var VoteItemBox = $(obj).parent();
	if(VoteItemBox)
	{
		VoteItemBox.remove();
	}
}
-->
</script>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="FormTable">
	<tr>
		<td class="FieldBox">
			标题</td>
		<td class="ValueBox">
			<asp:TextBox ID="CtrlTitle" runat="server"></asp:TextBox>
			<asp:RequiredFieldValidator ID="RFVCtrlTitle" runat="server" ControlToValidate="CtrlTitle"
				ErrorMessage="标题 不允许为空。">*</asp:RequiredFieldValidator>
		</td>
	</tr>
	<tr>
		<td class="FieldBox">
			摘要</td>
		<td class="ValueBox">
			<asp:TextBox ID="CtrlSummary" runat="server" Columns="40" Rows="5" TextMode="MultiLine"></asp:TextBox>
		</td>
	</tr>
	<tr>
		<td class="FieldBox">
			内容</td>
		<td class="ValueBox">
			<FCK:FCKeditor ID="CtrlContent" runat="server" Height="300px">
			</FCK:FCKeditor>
		</td>
	</tr>
	<tr>
		<td class="FieldBox">
			调查项</td>
		<td class="ValueBox">
			<div id="<%= this.ClientID %>_VoteItemsBox" class="VoteItemsBox">
			</div>
			<a href="javascript:<%= this.ClientID %>_AddVoteItem();" class="AddVoteItemButton">增加调查项</a>
		</td>
	</tr>
	<tr>
		<td class="FieldBox">
			用户自定义内容标题</td>
		<td class="ValueBox">
			<asp:TextBox ID="CtrlUserDefinedTitle" runat="server" Columns="40" Rows="5" TextMode="MultiLine"></asp:TextBox>
			<span class="FieldExplain">为空则不允许用户定义内容。</span>
		</td>
	</tr>
	<tr>
		<td class="FieldBox">
			自定义票数
		</td>
		<td class="ValueBox">
			<asp:TextBox ID="CtrlUserDefinedCount" runat="server"></asp:TextBox><span class="FieldExplain">[数字格式]</span>
			<asp:RequiredFieldValidator ID="RFVCtrlUserDefinedCount" runat="server" ControlToValidate="CtrlUserDefinedCount"
				ErrorMessage="自定义票数 不允许为空。">*</asp:RequiredFieldValidator>
			<asp:RegularExpressionValidator ID="REVCtrlUserDefinedCount" runat="server" ControlToValidate="CtrlUserDefinedCount"
				ValidationExpression="<%# Hxsoft.RegexExtensions.Pattern_Numerical %>" Display="None"
				ErrorMessage="自定义票数 的数据格式不符。">自定义票数 的数据格式不符。</asp:RegularExpressionValidator>
		</td>
	</tr>
	<tr>
		<td class="FieldBox">
			发布时间</td>
		<td class="ValueBox">
			<Hxctr:JSCalendarTextBox ID="CtrlReleaseDate" runat="server"></Hxctr:JSCalendarTextBox>
			<span class="FieldExplain">[日期格式]</span>
			<Hxctr:DateTimeValidator ID="DTVCtrlReleaseDate" runat="server" ControlToValidate="CtrlReleaseDate"
				Display="none" ErrorMessage="发布时间 的数据格式不符。">发布时间 的数据格式不符。</Hxctr:DateTimeValidator>
		    <asp:RequiredFieldValidator ID="RFVCtrlReleaseDate" runat="server" ControlToValidate="CtrlReleaseDate" ErrorMessage="字段 [发布时间] 不允许为空。">*</asp:RequiredFieldValidator>	
		</td>
	</tr>
	<tr>
		<td class="FieldBox">
			到期时间</td>
		<td class="ValueBox">
			<Hxctr:JSCalendarTextBox ID="CtrlExpirationDate" runat="server"></Hxctr:JSCalendarTextBox>
			<span class="FieldExplain">[日期格式]</span>
			<Hxctr:DateTimeValidator ID="DTVCtrlExpirationDate" runat="server" ControlToValidate="CtrlExpirationDate"
				Display="none" ErrorMessage="到期时间 的数据格式不符。">到期时间 的数据格式不符。</Hxctr:DateTimeValidator>
		</td>
	</tr>
	<tr>
		<td class="FieldBox">
			允许多选</td>
		<td class="ValueBox">			
			<asp:RadioButtonList ID="CtrlIsMultiSelect" runat="server" RepeatDirection="Horizontal">
				<asp:ListItem Value="False" Selected="True">否</asp:ListItem>
				<asp:ListItem Value="True">是</asp:ListItem>
			</asp:RadioButtonList>
		</td>
	</tr>
	<tr>
		<td class="FieldBox">
			允许匿名投票</td>
		<td class="ValueBox">			
			<asp:RadioButtonList ID="CtrlIsAnonymous" runat="server" RepeatDirection="Horizontal">
				<asp:ListItem Value="False" Selected="True">否</asp:ListItem>
				<asp:ListItem Value="True">是</asp:ListItem>
			</asp:RadioButtonList>
		</td>
	</tr>
	<tr>
		<td class="FieldBox">
			需填写联系人</td>
		<td class="ValueBox">			
			<asp:RadioButtonList ID="CtrlNeedContactInfo" runat="server" RepeatDirection="Horizontal">
				<asp:ListItem Value="False" Selected="True">否</asp:ListItem>
				<asp:ListItem Value="True">是</asp:ListItem>
			</asp:RadioButtonList>
		</td>
	</tr>
	<tr>
		<td class="FieldBox">
			所属频道
		</td>
		<td class="ValueBox">
			<Hxctr:DicCheckBoxList ID="CBLChannelIds" ClassCode="<%# Hxsoft.AppV1.Module.Common.DicClassName_ChannelCategory %>" RepeatDirection="Horizontal"
				RepeatColumns="4" RepeatLayout="Flow" runat="server" SiteId="<%#　SiteId %>" />
		</td>
	</tr>
</table>